package com.liang.hellocompose

import androidx.compose.animation.core.AnimationConstants
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import com.liang.hellocompose.ui.theme.Purple500


/**
 * @author suzl
 * @createTime 2021/8/4
 * @Description
 */
@Composable
fun SecondPage(paddingValues: PaddingValues, navController: NavController, title: String) {
    SecondContent(paddingValues, navController = navController, title = title)
}

@Composable
fun SecondContent(innerPadding: PaddingValues, navController: NavController, title: String) {

    Column(
        modifier = Modifier
            .padding(innerPadding)
            .fillMaxSize()
    ) {
        Text(
            modifier = Modifier
                .wrapContentWidth()
                .padding(10.dp)
                .align(Alignment.CenterHorizontally), text = title
        )
        Button(
            modifier = Modifier.align(Alignment.CenterHorizontally),
            onClick = {
                navController.popBackStack()
            }) {
            Text("click to back")
        }
    }
}
